/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: ResultVoUtil
 * Author:   Administrator
 * Date:     2018/4/29 0029 20:10
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.imooc.utils;

import com.imooc.vo.ResultVo;

/**
 * 〈一句话功能简述〉<br> 
 * 〈返回前台结果工具〉
 *
 * @author Administrator
 * @create 2018/4/29 0029
 * @since 1.0.0
 */
public class ResultVoUtil {

    public static ResultVo success(Object object){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(0);
        resultVo.setMsg("成功");
        resultVo.setData(object);

        return resultVo;
    }

    public static ResultVo success(){
        return success(null);
    }

    public static ResultVo error(Integer code, String msg){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(code);
        resultVo.setMsg(msg);
        return resultVo;
    }

}